###文件操作
#读文件
with open("./demo8.txt","r",encoding="utf-8") as file :
    #方法一 read()
    comment1 = file.read() 
    print(comment1) 

    #方法二 readlines()    结合for循环使用
    comment2 = file.readlines() 
    for line in comment2:
        print(line) 

    #方法三 readline()    结合while循环使用
    comment3 = file.readline() 
    while comment3 != "":
        print(comment3) 
        comment3 = file.readline() 